\section{RtAudio Class Reference}
\label{class_rt_audio}\index{RtAudio@{RtAudio}}


Realtime audio i/o C++ classes.  




{\ttfamily \#include $<$RtAudio.h$>$}

\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct {\bf DeviceInfo}
\begin{DoxyCompactList}\small\item\em The public device information structure for returning queried values. \item\end{DoxyCompactList}\item 
struct {\bf StreamOptions}
\begin{DoxyCompactList}\small\item\em The structure for specifying stream options. \item\end{DoxyCompactList}\item 
struct {\bf StreamParameters}
\begin{DoxyCompactList}\small\item\em The structure for specifying input or ouput stream parameters. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum {\bf Api} \{ \par
{\bf UNSPECIFIED}, 
{\bf LINUX\_\-ALSA}, 
{\bf LINUX\_\-OSS}, 
{\bf UNIX\_\-JACK}, 
\par
{\bf MACOSX\_\-CORE}, 
{\bf WINDOWS\_\-ASIO}, 
{\bf WINDOWS\_\-DS}, 
{\bf RTAUDIO\_\-DUMMY}
 \}
\begin{DoxyCompactList}\small\item\em Audio API specifier arguments. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf RtAudio} ({\bf RtAudio::Api} api=UNSPECIFIED)  throw ()
\begin{DoxyCompactList}\small\item\em The class constructor. \item\end{DoxyCompactList}\item 
{\bf $\sim$RtAudio} ()  throw ()
\begin{DoxyCompactList}\small\item\em The destructor. \item\end{DoxyCompactList}\item 
{\bf RtAudio::Api} {\bf getCurrentApi} (void)  throw ()\label{class_rt_audio_a83687634795792b2c47e4ae1cf8a5246}

\begin{DoxyCompactList}\small\item\em Returns the audio API specifier for the current instance of \doxyref{RtAudio}{p.}{class_rt_audio}. \item\end{DoxyCompactList}\item 
unsigned int {\bf getDeviceCount} (void)  throw ()
\begin{DoxyCompactList}\small\item\em A public function that queries for the number of audio devices available. \item\end{DoxyCompactList}\item 
{\bf RtAudio::DeviceInfo} {\bf getDeviceInfo} (unsigned int device)
\begin{DoxyCompactList}\small\item\em Return an \doxyref{RtAudio::DeviceInfo}{p.}{struct_rt_audio_1_1_device_info} structure for a specified device number. \item\end{DoxyCompactList}\item 
unsigned int {\bf getDefaultOutputDevice} (void)  throw ()
\begin{DoxyCompactList}\small\item\em A function that returns the index of the default output device. \item\end{DoxyCompactList}\item 
unsigned int {\bf getDefaultInputDevice} (void)  throw ()
\begin{DoxyCompactList}\small\item\em A function that returns the index of the default input device. \item\end{DoxyCompactList}\item 
void {\bf openStream} ({\bf RtAudio::StreamParameters} $\ast$outputParameters, {\bf RtAudio::StreamParameters} $\ast$inputParameters, {\bf RtAudioFormat} format, unsigned int sampleRate, unsigned int $\ast$bufferFrames, {\bf RtAudioCallback} callback, void $\ast$userData=NULL, {\bf RtAudio::StreamOptions} $\ast$options=NULL)
\begin{DoxyCompactList}\small\item\em A public function for opening a stream with the specified parameters. \item\end{DoxyCompactList}\item 
void {\bf closeStream} (void)  throw ()
\begin{DoxyCompactList}\small\item\em A function that closes a stream and frees any associated stream memory. \item\end{DoxyCompactList}\item 
void {\bf startStream} (void)
\begin{DoxyCompactList}\small\item\em A function that starts a stream. \item\end{DoxyCompactList}\item 
void {\bf stopStream} (void)
\begin{DoxyCompactList}\small\item\em Stop a stream, allowing any samples remaining in the output queue to be played. \item\end{DoxyCompactList}\item 
void {\bf abortStream} (void)
\begin{DoxyCompactList}\small\item\em Stop a stream, discarding any samples remaining in the input/output queue. \item\end{DoxyCompactList}\item 
bool {\bf isStreamOpen} (void) const   throw ()\label{class_rt_audio_a3863e45ff81dbe97176de0ee7545917f}

\begin{DoxyCompactList}\small\item\em Returns true if a stream is open and false if not. \item\end{DoxyCompactList}\item 
bool {\bf isStreamRunning} (void) const   throw ()\label{class_rt_audio_a84cc8d9b7ab9bc5f37bcf48430ec5aea}

\begin{DoxyCompactList}\small\item\em Returns true if the stream is running and false if it is stopped or not open. \item\end{DoxyCompactList}\item 
double {\bf getStreamTime} (void)
\begin{DoxyCompactList}\small\item\em Returns the number of elapsed seconds since the stream was started. \item\end{DoxyCompactList}\item 
long {\bf getStreamLatency} (void)
\begin{DoxyCompactList}\small\item\em Returns the internal stream latency in sample frames. \item\end{DoxyCompactList}\item 
unsigned int {\bf getStreamSampleRate} (void)
\begin{DoxyCompactList}\small\item\em Returns actual sample rate in use by the stream. \item\end{DoxyCompactList}\item 
void {\bf showWarnings} (bool value=true)  throw ()\label{class_rt_audio_af0752ee51cce3dd90a3bd009f9fdbe77}

\begin{DoxyCompactList}\small\item\em Specify whether warning messages should be printed to stderr. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void {\bf getCompiledApi} (std::vector$<$ {\bf RtAudio::Api} $>$ \&apis)  throw ()
\begin{DoxyCompactList}\small\item\em A static function to determine the available compiled audio APIs. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void {\bfseries openRtApi} ({\bf RtAudio::Api} api)\label{class_rt_audio_a087104938b7011d3e6fe2c09c55fb4b5}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
{\bf RtApi} $\ast$ {\bfseries rtapi\_\-}\label{class_rt_audio_ab2a64255e2563d501c1318dd9b60f471}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Realtime audio i/o C++ classes. \doxyref{RtAudio}{p.}{class_rt_audio} provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, Jack, and OSS), Macintosh OS X (CoreAudio and Jack), and Windows (DirectSound and ASIO) operating systems.

\doxyref{RtAudio}{p.}{class_rt_audio} WWW site: {\tt http://www.music.mcgill.ca/$\sim$gary/rtaudio/}

\doxyref{RtAudio}{p.}{class_rt_audio}: realtime audio i/o C++ classes Copyright (c) 2001-\/2010 Gary P. Scavone

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \char`\"{}Software\char`\"{}), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Any person wishing to distribute modifications to the Software is asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.

THE SOFTWARE IS PROVIDED \char`\"{}AS IS\char`\"{}, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 

\subsection{Member Enumeration Documentation}
\index{RtAudio@{RtAudio}!Api@{Api}}
\index{Api@{Api}!RtAudio@{RtAudio}}
\subsubsection[{Api}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf RtAudio::Api}}\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849}


Audio API specifier arguments. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{UNSPECIFIED@{UNSPECIFIED}!RtAudio@{RtAudio}}\index{RtAudio@{RtAudio}!UNSPECIFIED@{UNSPECIFIED}}\item[{\em 
UNSPECIFIED\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae}
}]Search for a working compiled API. \index{LINUX\_\-ALSA@{LINUX\_\-ALSA}!RtAudio@{RtAudio}}\index{RtAudio@{RtAudio}!LINUX\_\-ALSA@{LINUX\_\-ALSA}}\item[{\em 
LINUX\_\-ALSA\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8}
}]The Advanced Linux Sound Architecture API. \index{LINUX\_\-OSS@{LINUX\_\-OSS}!RtAudio@{RtAudio}}\index{RtAudio@{RtAudio}!LINUX\_\-OSS@{LINUX\_\-OSS}}\item[{\em 
LINUX\_\-OSS\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82}
}]The Linux Open Sound System API. \index{UNIX\_\-JACK@{UNIX\_\-JACK}!RtAudio@{RtAudio}}\index{RtAudio@{RtAudio}!UNIX\_\-JACK@{UNIX\_\-JACK}}\item[{\em 
UNIX\_\-JACK\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105}
}]The Jack Low-\/Latency Audio Server API. \index{MACOSX\_\-CORE@{MACOSX\_\-CORE}!RtAudio@{RtAudio}}\index{RtAudio@{RtAudio}!MACOSX\_\-CORE@{MACOSX\_\-CORE}}\item[{\em 
MACOSX\_\-CORE\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d}
}]Macintosh OS-\/X Core Audio API. \index{WINDOWS\_\-ASIO@{WINDOWS\_\-ASIO}!RtAudio@{RtAudio}}\index{RtAudio@{RtAudio}!WINDOWS\_\-ASIO@{WINDOWS\_\-ASIO}}\item[{\em 
WINDOWS\_\-ASIO\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469}
}]The Steinberg Audio Stream I/O API. \index{WINDOWS\_\-DS@{WINDOWS\_\-DS}!RtAudio@{RtAudio}}\index{RtAudio@{RtAudio}!WINDOWS\_\-DS@{WINDOWS\_\-DS}}\item[{\em 
WINDOWS\_\-DS\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931}
}]The Microsoft Direct Sound API. \index{RTAUDIO\_\-DUMMY@{RTAUDIO\_\-DUMMY}!RtAudio@{RtAudio}}\index{RtAudio@{RtAudio}!RTAUDIO\_\-DUMMY@{RTAUDIO\_\-DUMMY}}\item[{\em 
RTAUDIO\_\-DUMMY\label{class_rt_audio_ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1}
}]A compilable but non-\/functional API. \end{description}
\end{Desc}



\subsection{Constructor \& Destructor Documentation}
\index{RtAudio@{RtAudio}!RtAudio@{RtAudio}}
\index{RtAudio@{RtAudio}!RtAudio@{RtAudio}}
\subsubsection[{RtAudio}]{\setlength{\rightskip}{0pt plus 5cm}RtAudio::RtAudio (
\begin{DoxyParamCaption}
\item[{{\bf RtAudio::Api}}]{api = {\ttfamily UNSPECIFIED}}
\end{DoxyParamCaption}
)  throw ()}\label{class_rt_audio_afd0bfa26deae9804e18faff59d0273d9}


The class constructor. 

The constructor performs minor initialization tasks. No exceptions can be thrown.

If no API argument is specified and multiple API support has been compiled, the default order of use is JACK, ALSA, OSS (Linux systems) and ASIO, DS (Windows systems). \index{RtAudio@{RtAudio}!$\sim$RtAudio@{$\sim$RtAudio}}
\index{$\sim$RtAudio@{$\sim$RtAudio}!RtAudio@{RtAudio}}
\subsubsection[{$\sim$RtAudio}]{\setlength{\rightskip}{0pt plus 5cm}RtAudio::$\sim$RtAudio (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)  throw ()}\label{class_rt_audio_aa8a9716fd64680657ef69c9465442a2f}


The destructor. 

If a stream is running or open, it will be stopped and closed automatically. 

\subsection{Member Function Documentation}
\index{RtAudio@{RtAudio}!abortStream@{abortStream}}
\index{abortStream@{abortStream}!RtAudio@{RtAudio}}
\subsubsection[{abortStream}]{\setlength{\rightskip}{0pt plus 5cm}void RtAudio::abortStream (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_ad0586b47cd6bb9591a80b4052815991f}


Stop a stream, discarding any samples remaining in the input/output queue. 

An \doxyref{RtError}{p.}{class_rt_error} (type = SYSTEM\_\-ERROR) is thrown if an error occurs during processing. An \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. \index{RtAudio@{RtAudio}!closeStream@{closeStream}}
\index{closeStream@{closeStream}!RtAudio@{RtAudio}}
\subsubsection[{closeStream}]{\setlength{\rightskip}{0pt plus 5cm}void RtAudio::closeStream (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)  throw ()\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_a90d599002ad32cf250a4cb866f2cc93a}


A function that closes a stream and frees any associated stream memory. 

If a stream is not open, this function issues a warning and returns (no exception is thrown). \index{RtAudio@{RtAudio}!getCompiledApi@{getCompiledApi}}
\index{getCompiledApi@{getCompiledApi}!RtAudio@{RtAudio}}
\subsubsection[{getCompiledApi}]{\setlength{\rightskip}{0pt plus 5cm}void RtAudio::getCompiledApi (
\begin{DoxyParamCaption}
\item[{std::vector$<$ {\bf RtAudio::Api} $>$ \&}]{apis}
\end{DoxyParamCaption}
)  throw ()\hspace{0.3cm}{\ttfamily  [static]}}\label{class_rt_audio_a1df0b60d45637f65dab961b658056503}


A static function to determine the available compiled audio APIs. 

The values returned in the std::vector can be compared against the enumerated list values. Note that there can be more than one API compiled for certain operating systems. \index{RtAudio@{RtAudio}!getDefaultInputDevice@{getDefaultInputDevice}}
\index{getDefaultInputDevice@{getDefaultInputDevice}!RtAudio@{RtAudio}}
\subsubsection[{getDefaultInputDevice}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int RtAudio::getDefaultInputDevice (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)  throw ()\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_aad8b94edd3cd379ee300b125750ac6ce}


A function that returns the index of the default input device. 

If the underlying audio API does not provide a \char`\"{}default
    device\char`\"{}, or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. \index{RtAudio@{RtAudio}!getDefaultOutputDevice@{getDefaultOutputDevice}}
\index{getDefaultOutputDevice@{getDefaultOutputDevice}!RtAudio@{RtAudio}}
\subsubsection[{getDefaultOutputDevice}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int RtAudio::getDefaultOutputDevice (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)  throw ()\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_a3a3f3dbe13ea696b521e49cdaaa357bc}


A function that returns the index of the default output device. 

If the underlying audio API does not provide a \char`\"{}default
    device\char`\"{}, or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. \index{RtAudio@{RtAudio}!getDeviceCount@{getDeviceCount}}
\index{getDeviceCount@{getDeviceCount}!RtAudio@{RtAudio}}
\subsubsection[{getDeviceCount}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int RtAudio::getDeviceCount (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)  throw ()\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_a747ce2d73803641bbb66d6e78092aa1a}


A public function that queries for the number of audio devices available. 

This function performs a system query of available devices each time it is called, thus supporting devices connected {\itshape after\/} instantiation. If a system error occurs during processing, a warning will be issued. \index{RtAudio@{RtAudio}!getDeviceInfo@{getDeviceInfo}}
\index{getDeviceInfo@{getDeviceInfo}!RtAudio@{RtAudio}}
\subsubsection[{getDeviceInfo}]{\setlength{\rightskip}{0pt plus 5cm}{\bf RtAudio::DeviceInfo} RtAudio::getDeviceInfo (
\begin{DoxyParamCaption}
\item[{unsigned int}]{device}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_a02d7ff44ad1d7eae22283a052f3dfda8}


Return an \doxyref{RtAudio::DeviceInfo}{p.}{struct_rt_audio_1_1_device_info} structure for a specified device number. 

Any device integer between 0 and \doxyref{getDeviceCount()}{p.}{class_rt_audio_a747ce2d73803641bbb66d6e78092aa1a} -\/ 1 is valid. If an invalid argument is provided, an \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) will be thrown. If a device is busy or otherwise unavailable, the structure member \char`\"{}probed\char`\"{} will have a value of \char`\"{}false\char`\"{} and all other members are undefined. If the specified device is the current default input or output device, the corresponding \char`\"{}isDefault\char`\"{} member will have a value of \char`\"{}true\char`\"{}. \index{RtAudio@{RtAudio}!getStreamLatency@{getStreamLatency}}
\index{getStreamLatency@{getStreamLatency}!RtAudio@{RtAudio}}
\subsubsection[{getStreamLatency}]{\setlength{\rightskip}{0pt plus 5cm}long RtAudio::getStreamLatency (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_a843c989d9f501c71bc2f2c5ca18df9f3}


Returns the internal stream latency in sample frames. 

The stream latency refers to delay in audio input and/or output caused by internal buffering by the audio system and/or hardware. For duplex streams, the returned value will represent the sum of the input and output latencies. If a stream is not open, an \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) will be thrown. If the API does not report latency, the return value will be zero. \index{RtAudio@{RtAudio}!getStreamSampleRate@{getStreamSampleRate}}
\index{getStreamSampleRate@{getStreamSampleRate}!RtAudio@{RtAudio}}
\subsubsection[{getStreamSampleRate}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int RtAudio::getStreamSampleRate (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_a28214b8b05d60b45c24ee6fae7b2a0b5}


Returns actual sample rate in use by the stream. 

On some systems, the sample rate used may be slightly different than that specified in the stream parameters. If a stream is not open, an \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) will be thrown. \index{RtAudio@{RtAudio}!getStreamTime@{getStreamTime}}
\index{getStreamTime@{getStreamTime}!RtAudio@{RtAudio}}
\subsubsection[{getStreamTime}]{\setlength{\rightskip}{0pt plus 5cm}double RtAudio::getStreamTime (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_a344e59a62353c5791db4621b985cb2ca}


Returns the number of elapsed seconds since the stream was started. 

If a stream is not open, an \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) will be thrown. \index{RtAudio@{RtAudio}!openStream@{openStream}}
\index{openStream@{openStream}!RtAudio@{RtAudio}}
\subsubsection[{openStream}]{\setlength{\rightskip}{0pt plus 5cm}void RtAudio::openStream (
\begin{DoxyParamCaption}
\item[{{\bf RtAudio::StreamParameters} $\ast$}]{outputParameters, }
\item[{{\bf RtAudio::StreamParameters} $\ast$}]{inputParameters, }
\item[{{\bf RtAudioFormat}}]{format, }
\item[{unsigned int}]{sampleRate, }
\item[{unsigned int $\ast$}]{bufferFrames, }
\item[{{\bf RtAudioCallback}}]{callback, }
\item[{void $\ast$}]{userData = {\ttfamily NULL}, }
\item[{{\bf RtAudio::StreamOptions} $\ast$}]{options = {\ttfamily NULL}}
\end{DoxyParamCaption}
)}\label{class_rt_audio_afacc99740fa4c5606fb35467cdea6da8}


A public function for opening a stream with the specified parameters. 

An \doxyref{RtError}{p.}{class_rt_error} (type = SYSTEM\_\-ERROR) is thrown if a stream cannot be opened with the specified parameters or an error occurs during processing. An \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) is thrown if any invalid device ID or channel number parameters are specified.


\begin{DoxyParams}{Parameters}
{\em outputParameters} & Specifies output stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For input-\/only streams, this argument should be NULL. The device ID is an index value between 0 and \doxyref{getDeviceCount()}{p.}{class_rt_audio_a747ce2d73803641bbb66d6e78092aa1a} -\/ 1. \\
\hline
{\em inputParameters} & Specifies input stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For output-\/only streams, this argument should be NULL. The device ID is an index value between 0 and \doxyref{getDeviceCount()}{p.}{class_rt_audio_a747ce2d73803641bbb66d6e78092aa1a} -\/ 1. \\
\hline
{\em format} & An RtAudioFormat specifying the desired sample data format. \\
\hline
{\em sampleRate} & The desired sample rate (sample frames per second). \\
\hline
{\em $\ast$bufferFrames} & A pointer to a value indicating the desired internal buffer size in sample frames. The actual value used by the device is returned via the same pointer. A value of zero can be specified, in which case the lowest allowable value is determined. \\
\hline
{\em callback} & A client-\/defined function that will be invoked when input data is available and/or output data is needed. \\
\hline
{\em userData} & An optional pointer to data that can be accessed from within the callback function. \\
\hline
{\em options} & An optional pointer to a structure containing various global stream options, including a list of OR'ed RtAudioStreamFlags and a suggested number of stream buffers that can be used to control stream latency. More buffers typically result in more robust performance, though at a cost of greater latency. If a value of zero is specified, a system-\/specific median value is chosen. If the RTAUDIO\_\-MINIMIZE\_\-LATENCY flag bit is set, the lowest allowable value is used. The actual value used is returned via the structure argument. The parameter is API dependent. \\
\hline
\end{DoxyParams}
\index{RtAudio@{RtAudio}!startStream@{startStream}}
\index{startStream@{startStream}!RtAudio@{RtAudio}}
\subsubsection[{startStream}]{\setlength{\rightskip}{0pt plus 5cm}void RtAudio::startStream (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_aec017a89629ccef66a90b60be22a2f80}


A function that starts a stream. 

An \doxyref{RtError}{p.}{class_rt_error} (type = SYSTEM\_\-ERROR) is thrown if an error occurs during processing. An \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) is thrown if a stream is not open. A warning is issued if the stream is already running. \index{RtAudio@{RtAudio}!stopStream@{stopStream}}
\index{stopStream@{stopStream}!RtAudio@{RtAudio}}
\subsubsection[{stopStream}]{\setlength{\rightskip}{0pt plus 5cm}void RtAudio::stopStream (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [inline]}}\label{class_rt_audio_af4c241ff86936ecc8108f0d9dfe3efdd}


Stop a stream, allowing any samples remaining in the output queue to be played. 

An \doxyref{RtError}{p.}{class_rt_error} (type = SYSTEM\_\-ERROR) is thrown if an error occurs during processing. An \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
Include/{\bf RtAudio.h}\item 
Include/RtAudio.cpp\end{DoxyCompactItemize}
